<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>构建代码</title>
	<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
	<script src="../../../component/layui/layui.js"></script>
	<script src="../../../component/pear/pear.js"></script>
	<style>
		.layui-tab-title {
			position: fixed;
			left: 0;
			right: 0;
			top: 0;
			z-index: 997;
			background: #fff;
			height: 50px !important;
		}

		.layui-tab-title .layui-this:after {
			height: 51px;
		}

		.layui-tab-title li {
			height: 50px;
			line-height: 50px;
		}

		.layui-tab-content {
			position: absolute;
			top: 50px;
		}

		.margin-bottom {
			margin-bottom: 10px;
		}
	</style>
</head>

<body>
	<form class="layui-form" action="" lay-filter="form">
		<div class="mainBox">
			<div class="main-container">
				<div class="layui-form-item">
					<label class="layui-form-label">表名<span class="layui-font-red">*</span></label>
					<div class="layui-input-block">
						<input type="text" disabled name="tableName" lay-verify="required" placeholder="请输入表名"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">模块<span class="layui-font-red">*</span></label>
					<div class="layui-input-block">
						<select id="moduleName"></select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">实体类<span class="layui-font-red">*</span></label>
					<div class="layui-input-block">
						<input type="text" name="entityName" lay-verify="required" placeholder="请输入实体类名称"
							class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">作者<span class="layui-font-red">*</span></label>
					<div class="layui-input-block">
						<input type="text" name="author" lay-verify="required" placeholder="请输入作者" class="layui-input">
					</div>
				</div>
			</div>
		</div>
		<div class="bottom">
			<div class="button-container">
				<button type="submit" class="pear-btn pear-btn-sm pear-btn-primary" lay-submit="" lay-filter="save">
					<i class="icon pear-icon pear-icon-select-bold"></i>
					提交
				</button>
				<button type="button" lay-click="layerclose" class="pear-btn pear-btn-sm">
					<i class="icon pear-icon pear-icon-close-bold"></i>
					关闭
				</button>
			</div>
		</div>
	</form>
</body>

</html>

<script>
	layui.use(['form', 'jquery', 'context', 'permission', 'popup', 'tree', 'util', 'common', 'button'], function () {
		var form = layui.form;
		var $ = layui.jquery;
		var context = layui.context;
		var popup = layui.popup;
		var tree = layui.tree;
		var util = layui.util;
		var common = layui.common;
		var button = layui.button;

		var basePath = context.get("base-path");
		var tableName = common.getQueryString("tablename");
		var author = common.getQueryString("author");
		var entityName = common.getQueryString("entityName");

		common.loadSelect({
			divId: "#moduleName",
			name: "moduleName",
			url: basePath + '/api/system/buildcode/getmodulelist',
		})

		form.val("form", { tableName: curTableName });

		form.on("submit(save)", function (data) {
			var btn = button.load({ elem: "button[lay-filter=save]" });


			return false;
		});

		util.event('lay-click', {
			layerclose: function (othis) {//关闭当前弹窗
				parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
			},
		});

	})
</script>